package com.geekhome.player;

import com.geekhome.player.domain.dao.PlayerRepository;
import com.geekhome.player.domain.entity.PlayerBaseDO;
import com.geekhome.player.domain.valueobj.ZnCharacter;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * Copyright © 2019年 platform. All rights reserved.
 *
 * @author 临江仙 hzqiuxm@163.com
 * 初期采用分配账号的形式
 *
 * @date 2019/8/22 11:07
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class InitPlayers {

    @Autowired
    PlayerRepository playerRepository;

    @Test
    public void InitPlayers(){

        PlayerBaseDO playerBaseDO = new PlayerBaseDO();
        playerBaseDO.setUserName("程清骏");
        playerBaseDO.setShowName("三台");
        playerBaseDO.setCellNum("13989461462");
        playerBaseDO.setEmail("cailianren@163.com");
        playerBaseDO.setPassword("123321qq");
        playerBaseDO.setJc(1000);
        playerBaseDO.setGmtCreate(LocalDateTime.now());
        playerBaseDO.setGmtModfiy(LocalDateTime.now());
        playerBaseDO.setZnCharacter(getZS());

        playerRepository.save(playerBaseDO);


    }



    public ZnCharacter getZS(){

        ZnCharacter znCharacter = new ZnCharacter();

        znCharacter.setCharacterCode("ZS");
        znCharacter.setCharacterName("圣战士");
        znCharacter.setLevel(3);
        znCharacter.setCurrentExp(5000L);
        znCharacter.setNextExp(19500L);

        znCharacter.setSpecialFlag(false);

        return znCharacter;


    }


    /**
     *
     * @param grade  1 法师学徒  2 流浪法师 3 魔法师 4 魔导士 5 魔导师 6 圣魔导
     * @return
     */
    public ZnCharacter getFS(String grade){


        String charactorCode = "FS";
        String charactorName;
//        String




        ZnCharacter znCharacter = new ZnCharacter();
//        znCharacter.setCharacterCode("");
//        znCharacter.setCharacterName();
//        znCharacter.setLevel();
//        znCharacter.setCurrentExp();
//        znCharacter.setNextExp();

        return  znCharacter;

    }

}
